package sj.mappers;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import sj.pojo.Wallet;

import java.math.BigDecimal;

@Mapper
public interface WalletMapper {
    // 1.查询用户钱包余额
    BigDecimal getMoneyInWallet(@Param("userId") Integer userId);

    // 2. 用户消费 100 元
    Integer decreaseMoneyInWallet(@Param("userId") Integer userId, @Param("money") BigDecimal decreaseMoney);


    Wallet getMoneyAndIdByUserId(@Param("userId")Integer userId);

    Integer refundToWallet(Wallet wallet);

}
